import { request } from '@/api/request'

// 可用区域
export function availabilityZone(data) {
  return request({
    url: '/cloud/novaListAvailabilityZones',
    method: 'get',
    params: data
  })
}
// 区域选择
export function regionList(data) {
  return request({
    url: '/cloud/regionList',
    method: 'get',
    data: data
  })
}

// 查询规格详情和规格扩展信息列表
export function listFlavors(data) {
  return request({
    url: '/cloud/listFlavors',
    method: 'post',
    data: data
  })
}

// 查询镜像列表
export function glanceListImages(data) {
  return request({
    url: '/cloud/glanceListImages',
    method: 'post',
    data: data
  })
}

// 加入购物车
export function shoppingCar(data) {
  return request({
    url: '/system/car',
    method: 'post',
    data: data
  })
}

// 系统设置
export function setting(params) {
  return request({
    url: '/system/setting/list',
    method: 'get',
    params
  })
}

// 文件上传
export function upload(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data
  })
}

// 文件下载
export function download(params) {
  return request({
    url: '/common/download',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 下载发票
export function invoiceDownload(data) {
  return request({
    url: '/system/invoiceManagement/download',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

// 发送短信
export function sendMsg(data) {
  return request({
    url: '/sms/sendMsg/REGISTER',
    method: 'post',
    data
  })
}

// 发送登录短信
export function sendLoginMsg(data) {
  return request({
    url: '/sms/sendMsg/LOGIN',
    method: 'post',
    data
  })
}

// 全局搜索
export function globalSearch(params) {
  return request({
    url: '/index/global/search',
    method: 'get',
    params: params
  })
}

// Vpcs
export function listVpcs(params) {
  return request({
    url: '/cloud/listVpcs',
    method: 'get',
    params: params
  })
}

// 子网
export function listSubnets(data) {
  return request({
    url: '/cloud/listSubnets',
    method: 'post',
    data
  })
}